package com.atguigu.yygh.oss.util;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantPropertiesUtils implements InitializingBean {

	    @Value("${aliyun.oss.endpoint}")
	    private String apiUrl;
	 
	    @Value("${aliyun.oss.accessKeyId}")
	    private String appId;
	 
	    @Value("${aliyun.oss.secret}")
	    private String appSecret;
	 
	    //设置过期时间
	    @Value("${aliyun.oss.bucket}")
	    private String bucket;


       public static String API_URL;
       public static String APP_ID;
       public static String APP_SECRECT;
       public static String BUCKET;

    @Override
    public void afterPropertiesSet() throws Exception {
        API_URL = apiUrl;
        APP_ID = appId;
        APP_SECRECT = appSecret;
        BUCKET = bucket;
        
    }
}
